package fuzzylizard.teamdocs.domain;

import java.io.Serializable;
import java.util.List;

/**
 * represents a file that a user uploads to the system
 * 
 */
public class Document extends File implements Serializable {

    private String summary;

    private Document(String name) {
        super(name);
    }
    
    private Document(String name, User createdBy) {
        super(name, createdBy);
    }

    /**
     * Static method for creating documents. Gives the directory a name and sets the created
     * date and time
     * 
     * @param name The name of the document
     * @return freshly minted document
     */
    public static Document make(String name) {
        return new Document(name);
    }

    /**
     * Static method for creating documents. Gives the document a name, sets the User who
     * created the document, and sets the created date and time
     *
     * @param name The name of the document
     * @param createdBy The user who created the document
     * @return freshly minted document
     */
    public static Document make(String name, User createdBy) {
        return new Document(name, createdBy);
    }

    /**
     * 
     * @return Document summary
     */
    public String summary() {
        return summary;
    }

    /**
     * 
     * @param summary Description of document
     */
    public void setSummary(String summary) {
        this.summary = summary;
    }

    /**
     * This does nothing since a document cannot contain other documents
     * @param file
     * @return false
     */
    @Override
    public boolean addFile(File file) {
        return false;
    }

    /**
     * Does nothing and always returns false
     * @param file
     * @return
     */
    @Override
    public boolean contains(File file) {
        return false;
    }

    /**
     * Does nothing and always returns null
     * @return null
     */
    @Override
    public List<File> files() {
        return null;
    }

    /**
     * Does nothing and always returns null
     * @param file
     * @return null
     */
    @Override
    public File getFile(File file) {
        return null;
    }

    /**
     * Does nothing and always returns null
     * @param file
     * @return null
     */
    @Override
    public File removeFile(File file) {
        return null;
    }
}
